﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cqrs.StateMachineDesigner.CustomCode;

namespace Cqrs.StateMachineDesigner.Generator
{
    public class GeneratorModel
    {
        public string Namespace { get; set; }
        public string DomainName { get; set; }
        public IList<CommandEventModel> CommandEventModel { private set; get; }
        public IList<DomainProperty> DomainProperties { private set; get; }
        public IList<CommandEventModel> EventsWithCommands
        {
            get
            {
                return CommandEventModel.Where(p => p.DomainMethod.Trim().Length > 0).ToList();
            }
        }

        public GeneratorModel(
            string domainNamespace,
            string domainName,
            IList<CommandEventModel> commandEventModel, 
            IList<DomainProperty> domainProperties)
        {
            this.Namespace = domainNamespace;
            this.DomainName = domainName;
            this.CommandEventModel = commandEventModel;
            this.DomainProperties = domainProperties;
        }
    }
}
